#include <iostream>
#include <string>
#include <Windows.h>

#include "Game.h"

#include "vec2.h"
#include "mat.h"

#include "Polygon.h"
#include "MapBuilder.h"

int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
			PSTR lpCmdLine, INT nCmdShow)
{



	try
	{

		Game game("foobar", true, 800, 600);
		game.Run();
	}
	catch (std::exception& e)
	{
		std::cout << "error: " << e.what() << std::endl;
	#ifdef _WIN32
		OutputDebugStringA((std::string(e.what()) + '\n').c_str());
	#endif
		return -1;
	}
	catch (...)
	{
		std::cout << "unknow exception\n" << std::flush;
	#ifdef _WIN32
		OutputDebugStringA("unknow exception\n");
	#endif
		return -1;
	}

	return 0;
}